﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ExtensionMethodsS
{
    public static class ExtensionClass
    {
        public static bool IsCapitalized(this string s)
        {
            if (string.IsNullOrEmpty(s)) return false;
            return char.IsUpper(s[0]);
        }
        public static string GetStar(this string s, int n)
        {
            //for (int i = 0; i < n; i++)
            //{
            //    s += "*";
            //}
            //return s;

            return s.PadRight(s.Length + n, '*');//PadRight:Unicode 填充字符。
        }
    }
}
